#pragma once

#include <iostream>

#define C_SHARP_MAX_OBJECTS 1000

/**
 * @brief 边界框信息结构体
 */
struct bbox_t {
    int id = -1;
    float prob = 0.f;
    unsigned int x, y, w, h;
};

/**
 * @brief 图像数据结构体
 */
struct image_t {
    int h = 0;
    int w = 0;
    int c = 0;

    float **rgbf = 0;
    unsigned char **rgb8 = 0;
    unsigned short **rgb16 = 0;

    float **dev_rgbf = 0;
    unsigned char **dev_rgb8 = 0;
    unsigned short **dev_rgb16 = 0;
};

/**
 * @brief 边界框容器结构体
 */
struct bbox_t_container {
    bbox_t candidates[C_SHARP_MAX_OBJECTS];
};

/**
 * @brief 目标检测数据结构体
 */
struct st_dlm_data
{
    image_t img;
    float prob_threshold = 0.3f;
    float nms_threshold = 0.5f;
    bbox_t result_boxs[C_SHARP_MAX_OBJECTS];
    int result_box_num = 0;
};

/**
 * @brief 精度模式枚举
 */
enum PRECISION_MODE
{
    PRECISION_FP32,
    PRECISION_FP16,
    PRECISION_INT8,
};

/**
 * @brief 模型输入信息结构体
 */
struct st_trans_model_input 
{
    std::string cfg_path;
    std::string model_path;
    PRECISION_MODE precison = PRECISION_FP16;
    std::string gpu_model = "NVIDIA GeForce RTX 3060";
    std::string trans_path;
};

const static int MAX_NUM_ANCHORS = 4;
const static int MAX_STRIDES = 4;

/**
 * @brief OpenVINO加密信息结构体
 */
struct st_encrypt_info_ovino {
    char gpu_model[100];
    int batch_size;
    int class_num;
    int input_channel;
    int image_width;
    int image_height;
    int num_anchors_size;
    std::vector<int> num_anchors;
    int stride_num;
    std::vector<int> strides;

    size_t engine_size;
    size_t bin_size;
    size_t xml_size;

    float obj_threshold;
    float nms_threshold;
};
